File src/class/Package.php
class Tlf\User\Package
See source code at /src/class/Package.php
Constants
Properties
-
public string $fqn = 'taeluf:user'; -
public string $name = 'user'; -
public readonly \Tlf\User\Lib $lib; -
public readonly string $config_file; -
protected bool $use_risky_web_initialization = false; -
protected bool $enable_admin_dashboard = false; -
protected array $dashboard_items;key is name to show to user. value is a view name
Methods
-
public function __construct(\Lia $lia, \PDO $pdo, array $configs) -
public function link(string $link_name): stringGet the html for a link within this library. -
public function links(...$links): stringGet the html for a list of links within this lib. -
public function update_configs(array $configs)Updates the configs, but does not change the base_url, which is configured during instantiation. -
public function use_config_file(string $json_path)Load configs from the named config file. This config file will also be used by the risky_web_initialization() to store configs. Alternatively, just pass an array to the constructor of this class.
If file does not exist, program continues as normal
-
public function enable_risky_web_initialization(string $initialization_pin_file)The easiest way to initialize configs for your user library. This gives you a web page to input your mail server settings and to initialize the database.
There are several security measures to prevent unauthorized access, BUT this should not be called in production BECAUSE it exposes administrative functionality that, if exploited, could cause real problems.
You don't want some unexpected error or hack to let somebody change your mail server credentials. This could expose all your users to phishing attacks.
So you should push to test or production, do the initial setup via the gui, then comment out the method call & push the updated code to the server after things are initialized. Be sure to delete the local initialization pin file before pushing changes.
-
public function enable_admin_dashboard()Enables views for the admin dasbhoard, which allows configuration of the mail server & some other settings that would otherwise be configured through code. -
public function get_user(): \Tlf\UserGet the current user.
If there is no active login, a user is returned that is neither registered nor logged in and is not in the database. -
public function get_dashboards() -
public function add_main_dashboards()DASHBOARD_WILL_DISPLAY hook to setup dashboards -
public function add_user_dashboard(string $name, string $view_name)